# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=tree-sitter-markdown
pkgver=0.2.3
pkgrel=0
pkgdesc="A markdown grammar for tree-sitter"
url="https://github.com/Mdeiml/tree-sitter-markdown"
arch="all"
license="MIT"
makedepends="tree-sitter-dev"
subpackages="$pkgname-doc"
provides="tree-sitter-markdown-inline=$pkgver-r$pkgrel"
install_if="tree-sitter-grammars"
source="$pkgname-$pkgver.tar.gz::https://github.com/Mdeiml/tree-sitter-markdown/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # no tests for shared lib

_langs='markdown markdown-inline'

build() {
	local lang; for lang in $_langs; do
		abuild-tree-sitter build -s "tree-sitter-$lang/src"
	done
}

package() {
	local lang; for lang in $_langs; do
		DESTDIR="$pkgdir" abuild-tree-sitter install -s "tree-sitter-$lang/src"
	done
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
8b6849d6dc964c82e45c3d18599d9f3e0ee9656a5085a9ec47f72d0343969e379ce190628a04dae64cb4ecdca2497e6d33ca7175e1f73796742a3ee6ffea743f  tree-sitter-markdown-0.2.3.tar.gz
"
